package com.pengweiwei.androidzygote.functions.imagetransform;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.pengweiwei.androidzygote.R;
import com.putong35.common.baseactfrag.activity.BaseActivity;

import butterknife.BindView;
import jp.wasabeef.glide.transformations.BlurTransformation;

public class ImageTransformActivity extends BaseActivity {


    @BindView(R.id.ivGaussBlur)
    ImageView ivGaussBlur;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String url = "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2330837767,198335777&fm=23&gp=0.jpg";
        Glide.with(this)
                .load(R.mipmap.ic_launcher)
                .crossFade(1000)
                .bitmapTransform(new BlurTransformation(this, 10, 1)) // “23”：设置模糊度(在0.0到25.0之间)，默认”25";"4":图片缩放比例,默认“1”。
                .into(ivGaussBlur);
    }

    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.activity_image_transform, null);
    }
}
